<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
	.tijiao{
		 float: right;
		 border: 1px solid;
		/*  margin-top: -16px; */
	}
</style>
</head>
<body>
	<div class="head">
			<div class="wrapper clearfix">
				<div class="clearfix" id="top">
					<h1 class="fl"><a href="index.jsp"><img src="<%=basePath%>frontPage/img/logo.png"/></a></h1>
					<div class="fr clearfix" id="top1">
						<c:if test="${empty userId}">
							<p class="fl">
								<a href="<%=basePath%>frontPage/login.jsp" id="login" >登录${name }</a>
								<a href="reg.jsp" id="reg">注册</a>
							</p>
						</c:if>
						<c:if test="${not empty userId}">
							<p class="fl">
								<a href="login.jsp" id="login" >您好,${user.name }</a>
								<button  id="turnOff" onclick="turnOff()">退出登录</button>
							</p>
						</c:if>
						<form action="<%=basePath %>frontPage/productListMh" method="post" class="fl">
							<input type="text" placeholder="热门搜索：韦德之道" name="name" style="margin-top: 8px;"/>
							<input type="submit" class="tijiao"/>
						</form>
						<div class="btn fl clearfix">
							<c:if test="${empty userId}">
								<a href="<%=basePath%>frontPage/login.jsp"><img src="<%=basePath%>frontPage/img/grzx.png"/></a>
							</c:if>
							<c:if test="${not empty userId}">
								<a href="<%=basePath%>toMySelfPage/${userId}"><img src="<%=basePath%>frontPage/img/grzx.png"/></a>
							</c:if>
							<a href="#" class="er1"><img src="<%=basePath%>frontPage/img/ewm.png"/></a>
							<c:if test="${empty userId}">
								<a href="<%=basePath%>frontPage/login.jsp"><img src="<%=basePath%>frontPage/img/gwc.png"/></a>
							</c:if>
							<c:if test="${not empty userId}">
								<a href="<%=basePath%>toShoppingCartPage/${userId}"><img src="<%=basePath%>frontPage/img/gwc.png"/></a>
							</c:if>
							<p><a href="#"><img src="<%=basePath%>frontPage/img/smewm.png"/></a></p>
						</div>
					</div>
				</div>
				<ul class="clearfix" id="bott">
					<li><a href="<%=basePath%>frontPage/index">首页</a></li>
					<li>
						<a href="#">所有商品</a>
						<div class="sList">
							<div class="wrapper  clearfix">
								<c:forEach items="${productTypes }" var="productTypes">
									<a href="/market/frontPage/productList/${productTypes.id}">
										<dl>
											<dt><img src="<%=basePath%>${productTypes.ext1}"/></dt>
											<dd>${productTypes.name }</dd>
										</dl>
									</a>
								</c:forEach>
							</div>
						</div>
					</li>
					<c:forEach items="${productTypes1 }" var="productTypes1">
						<li>
							<a href="">${productTypes1.name }</a>
							<div class="sList2">
								<div class="clearfix">
									<c:forEach items="${productTypes2 }" var="productTypes2">
										<c:if test="${productTypes1.id==productTypes2.p_id }">
											<a href="/market/frontPage/productList/${productTypes2.id }">${productTypes2.name }</a>
										</c:if>
									</c:forEach>
								</div>
							</div>
						</li>	
					</c:forEach>
				</ul>
			</div>
		</div>
</body>
</html>